package net.garagecoders.trofeos;

import java.util.ArrayList;
import java.util.List;
import java.util.Random;

import android.app.Activity;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Canvas;
import android.graphics.Point;
import android.graphics.drawable.Drawable;
import android.os.Bundle;

import com.google.android.maps.GeoPoint;
import com.google.android.maps.MapActivity;
import com.google.android.maps.MapController;
import com.google.android.maps.MapView;
import com.google.android.maps.Overlay;
import com.google.android.maps.OverlayItem;
import com.google.android.maps.MapView.LayoutParams;  
import android.view.View;
import android.widget.LinearLayout;

public class GoogleMapsActivity extends MapActivity {
	
	MapView mapView;
	MapController mc;
    GeoPoint p, p1, p2, p3;
    /** Called when the activity is first created. */
    
	List<Overlay> mapOverlays;
	Drawable drawable;
	Drawable drawable2;
	Drawable drawable3;
	Drawable drawable4;
	Marcador itemizedOverlay;
	Marcador itemizedOverlay2;
	Marcador itemizedOverlay3;
	Marcador itemizedOverlay4;
     
	@Override
	protected boolean isRouteDisplayed() {
		// TODO Auto-generated method stub
		return false;
	}
	
	@Override
    public void onCreate(Bundle savedInstanceState) {
        
        /*String coordinates[] = {"19.432726952083232", "-99.1333132982254","19.432190716063193","-99.1344827413559","19.43355659677633"
        		,"-99.13556098937988","19.435843156552497","-99.13202583789825"};*/
		
		super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        
        mapView = (MapView) findViewById(R.id.main_view); 
		mapView.setBuiltInZoomControls(true);

		mapOverlays = mapView.getOverlays();

		// first overlay
		drawable = getResources().getDrawable(R.drawable.azteca);
		itemizedOverlay = new Marcador(drawable, mapView);

		GeoPoint point = new GeoPoint((int)(19.432190716063193*1E6),(int)(-99.1344827413559*1E6));
		OverlayItem overlayItem = new OverlayItem(point, "Tomorrow Never Dies (1997)", 
				"(M gives Bond his mission in Daimler car)");
		itemizedOverlay.addOverlay(overlayItem);

		GeoPoint point2 = new GeoPoint((int)(19.432726952083232*1E6),(int)(-99.1333132982254*1E6));
		OverlayItem overlayItem2 = new OverlayItem(point2, "GoldenEye (1995)", 
				"(Interiors Russian defence ministry council chambers in St Petersburg)");		
		itemizedOverlay.addOverlay(overlayItem2);

		mapOverlays.add(itemizedOverlay);

		// second overlay
		drawable2 = getResources().getDrawable(R.drawable.chipt);
		itemizedOverlay2 = new Marcador(drawable2, mapView);

		GeoPoint point3 = new GeoPoint((int)(19.43355659677633*1E6),(int)(-99.13556098937988*1E6));
		OverlayItem overlayItem3 = new OverlayItem(point3, "Sliding Doors (1998)", 
				"(interiors)");
		itemizedOverlay2.addOverlay(overlayItem3);

		GeoPoint point4 = new GeoPoint((int)(19.435843156552497*1E6),(int)(-99.13202583789825*1E6));
		OverlayItem overlayItem4 = new OverlayItem(point4, "Mission: Impossible (1996)", 
				"(Ethan & Jim cafe meeting)");		
		itemizedOverlay2.addOverlay(overlayItem4);

		mapOverlays.add(itemizedOverlay2);
		
		// thirth overlay
		drawable3 = getResources().getDrawable(R.drawable.monja);
		itemizedOverlay = new Marcador(drawable3, mapView);

		GeoPoint point5 = new GeoPoint((int)(19.43023*1E6),(int)(-99.12543*1E6));
		OverlayItem overlayItem5 = new OverlayItem(point5, "Tomorrow Never Dies (1997)", 
				"(M gives Bond his mission in Daimler car)");
		itemizedOverlay.addOverlay(overlayItem5);

		GeoPoint point6 = new GeoPoint((int)(119.43453*1E6),(int)(-99.142889*1E6));
		OverlayItem overlayItem6 = new OverlayItem(point6, "GoldenEye (1995)", 
				"(Interiors Russian defence ministry council chambers in St Petersburg)");		
		itemizedOverlay.addOverlay(overlayItem6);

		mapOverlays.add(itemizedOverlay);

		// fourth overlay
		drawable4 = getResources().getDrawable(R.drawable.taco);
		itemizedOverlay2 = new Marcador(drawable4, mapView);

		GeoPoint point7 = new GeoPoint((int)(19.431512*1E6),(int)(-99.130918*1E6));
		OverlayItem overlayItem7 = new OverlayItem(point7, "Sliding Doors (1998)", 
				"(interiors)");
		itemizedOverlay2.addOverlay(overlayItem7);

		GeoPoint point8 = new GeoPoint((int)(19.433586*1E6),(int)(-99.138375*1E6));
		OverlayItem overlayItem8 = new OverlayItem(point8, "Mission: Impossible (1996)", 
				"(Ethan & Jim cafe meeting)");		
		itemizedOverlay2.addOverlay(overlayItem8);

		mapOverlays.add(itemizedOverlay2);

		final MapController mc = mapView.getController();
		mc.animateTo(point2);
		mc.setZoom(16);
		
		mapView.setStreetView(true);
    }
}